<?php if($_SESSION['config_template']=='layoutmain_web1') {?>
<div style="clear:both;"></div>
<div class="base-mini">
	<div class="head">
		<h4><?php echo $title;?>
			<?php if(isset($login)&& $login =="1" && isset($permission) && $permission=="true")  {?>
			<!-- Tạo cây bút chì click and change -->
			<div style="float: right;margin-right:5px; margin-top:-5px;">
			<ul class="gallery clearfix">
				<a href="/category/clickchange?iframe=true&width=370&height=250" rel="prettyPhoto[iframe]">
					<img src="/images/Pencil.png" style="width:20px ; height:20px; margin-top:2px;"></img>
				</a>
			</ul>
			</div>
			<!-- End - Tạo cây bút chì  click and change -->
			
			<!-- Tạo nút add cho click and change -->
			<div style="float: right;margin-right:10px; margin-top:-5px;"  >
			<ul class="gallery clearfix">
				<a href="/category/addpcategory?catetype=<?php echo $type; ?>&iframe=true&width=370&height=150" rel="prettyPhoto[iframe]">
					<img src="/images/button_add.png" style="width:20px ; height:20px; margin-top:2px;"></img>
				</a>
			</ul>
			</div>
			<!-- End - Tạo nút add cho click and change -->
			<?php  }?>
		</h4>
	</div>
	<div class="middle_box">
		<link rel="stylesheet" type="text/css" href="/css/web1/category.css" />
		<div id="categories">
			<div id="navigation" style="margin-top:-5px;">
				<ul style="padding-top:0px">
				<?php foreach ($Pprocategory as $pcategory){ ?>
					<li class='category'>
						<div style="float:left;">
							<a href="/<?php echo $type;?>/category?category=<?php echo $pcategory['category_id']; ?>"><?php echo $pcategory['category_name'];?></a>						
						</div>
						<?php if(isset($login)&& $login =="1" && isset($permission) && $permission=="true")  {?>
						<div style="float:right;border-bottom:0px dotted #aaa;">
							<!--nút xóa-->
							<div style="float:right; margin-top:-4px;">
								<input type="button" id="" onclick="delcate(<?php echo $pcategory['category_id']; ?>)"  value="" style="background-image: url('/images/button_del.png'); border: none; width:20px;height:20px;margin-top:11px;">												
							</div>
							<!--bút chì-->
							<div style="float:right; margin-top:-12px;">
								<ul class="gallery clearfix">
								<a style="border-bottom:0px dotted #aaa;" href="/category/editpcategory?cateid=<?php echo $pcategory['category_id']; ?>&iframe=true&width=370&height=320" rel="prettyPhoto[iframe]">
									<img src="/images/Pencil.png" style="width:20px ; height:20px;margin-top:10px;" />
								</a>
								</ul>
							</div>
							<!--nút add-->
							<div style="float:right; margin-top:-12px;">
								<ul class="gallery clearfix">
								<a style="border-bottom:0px dotted #aaa;" href="/category/addlcategory?catetype=<?php echo $type; ?>&parent=<?php echo $pcategory['category_id']; ?>&iframe=true&width=370&height=150" rel="prettyPhoto[iframe]">
									<img src="/images/button_add.png" style="width:20px ; height:20px; margin-top:10px;"></img>
								</a>
								</ul>
							</div>
						</div>
						<?php  }?>
						<ul>
							<?php foreach ($Lprocategory as $lcategory){
									if($lcategory['parent_id']==$pcategory[category_id]){?>
							<li>
								<div style="float:left;height: 0px;">
									<a href="/<?php echo $type;?>/category?category=<?php echo $lcategory['category_id']; ?>"><?php echo $lcategory['category_name'];?></a>
								</div>
								<?php if(isset($login)&& $login =="1" && isset($permission) && $permission=="true")  {?>
								<div style="float:right;height: 0px;">
									<!--nút del-->
									<div style="float:right; margin-top:-2px;">
										<input type="button" id="" onclick="delcate(<?php echo $lcategory['category_id']; ?>)"  value="" style="background-image: url('/images/button_del.png'); border: none; width:20px;height:20px;">												
									</div>
									<!-- bút chì-->
									<div style="float:right; margin-top:-12px;">
										<ul class="gallery clearfix">
										<a style="border-bottom:0px dotted #aaa;" href="/category/editlcategory?cateid=<?php echo $lcategory['category_id']; ?>&iframe=true&width=370&height=320" rel="prettyPhoto[iframe]">
											<img src="/images/Pencil.png" style="width:20px ; height:20px;" />
										</a>
										</ul>
									</div>
								</div>
								<?php } ?>
							</li>
								<?php } ?>
							<?php } ?>
						</ul>
						<div style="clear: both;"></div>
					</li>
					
				<?php }?>
				</ul>
			</div>
		</div><!--end categories-->
		<div style="clear:both"></div>
	</div>
	<div class="bottom_box"><span></span></div>
</div>
<?php } else if($_SESSION['config_template']=='layoutmain_web2') { ?>
	<div style="clear:both;"></div>
	<div class="top_box"><span> </span></div>
	<div class="box currency-switcher">
	<div class="head">
		<h4><?php echo $title;?>
			<?php if(isset($login)&& $login =="1" && isset($permission) && $permission=="true")  {?>
			<!-- Tạo cây bút chì click and change -->
			<div style="float: right;margin-right:5px; margin-top:-5px;">
			<ul class="gallery clearfix">
				<a href="/category/clickchange?iframe=true&width=370&height=250" rel="prettyPhoto[iframe]">
					<img src="/images/Pencil.png" style="width:20px ; height:20px; margin-top:2px;"></img>
				</a>
			</ul>
			</div>
			<!-- End - Tạo cây bút chì  click and change -->
			
			<!-- Tạo nút add cho click and change -->
			<div style="float: right;margin-right:10px; margin-top:-5px;"  >
			<ul class="gallery clearfix">
				<a href="/category/addpcategory?catetype=<?php echo $type; ?>&iframe=true&width=370&height=150" rel="prettyPhoto[iframe]">
					<img src="/images/button_add.png" style="width:20px ; height:20px; margin-top:2px;"></img>
				</a>
			</ul>
			</div>
			<!-- End - Tạo nút add cho click and change -->
			<?php  }?>
		</h4>
	</div>
	<div class="content_current">
		<link rel="stylesheet" type="text/css" href="/css/web2/category.css" />
		<div id="categories">
			<div id="navigation" style="margin-top:-5px;">
				<ul style="padding-top:0px">
				<?php foreach ($Pprocategory as $pcategory){ ?>
					<li class='category'>
						<div style="float:left;">
							<a href="/<?php echo $type;?>/category?category=<?php echo $pcategory['category_id']; ?>"><?php echo $pcategory['category_name'];?></a>						
						</div>
						<?php if(isset($login)&& $login =="1" && isset($permission) && $permission=="true")  {?>
						<div style="float:right;border-bottom:0px dotted #aaa;">
							<!--nút xóa-->
							<div style="float:right; margin-top:-4px;">
								<input type="button" id="" onclick="delcate(<?php echo $pcategory['category_id']; ?>)"  value="" style="background-image: url('/images/button_del.png'); border: none; width:20px;height:20px;margin-top:11px;">												
							</div>
							<!--bút chì-->
							<div style="float:right; margin-top:-12px;">
								<ul class="gallery clearfix">
								<a style="border-bottom:0px dotted #aaa;" href="/category/editpcategory?cateid=<?php echo $pcategory['category_id']; ?>&iframe=true&width=370&height=320" rel="prettyPhoto[iframe]">
									<img src="/images/Pencil.png" style="width:20px ; height:20px;margin-top:10px;" />
								</a>
								</ul>
							</div>
							<!--nút add-->
							<div style="float:right; margin-top:-12px;">
								<ul class="gallery clearfix">
								<a style="border-bottom:0px dotted #aaa;" href="/category/addlcategory?catetype=<?php echo $type; ?>&parent=<?php echo $pcategory['category_id']; ?>&iframe=true&width=370&height=150" rel="prettyPhoto[iframe]">
									<img src="/images/button_add.png" style="width:20px ; height:20px; margin-top:10px;"></img>
								</a>
								</ul>
							</div>
						</div>
						<?php  }?>
						<ul>
							<?php foreach ($Lprocategory as $lcategory){
									if($lcategory['parent_id']==$pcategory[category_id]){?>
							<li>
								<div style="float:left;height: 0px;">
									<a href="/<?php echo $type;?>/category?category=<?php echo $lcategory['category_id']; ?>"><?php echo $lcategory['category_name'];?></a>
								</div>
								<?php if(isset($login)&& $login =="1" && isset($permission) && $permission=="true")  {?>
								<div style="float:right;height: 0px;">
									<!--nút del-->
									<div style="float:right; margin-top:-2px;">
										<input type="button" id="" onclick="delcate(<?php echo $lcategory['category_id']; ?>)"  value="" style="background-image: url('/images/button_del.png'); border: none; width:20px;height:20px;">												
									</div>
									<!-- bút chì-->
									<div style="float:right; margin-top:-12px;">
										<ul class="gallery clearfix">
										<a style="border-bottom:0px dotted #aaa;" href="/category/editlcategory?cateid=<?php echo $lcategory['category_id']; ?>&iframe=true&width=370&height=320" rel="prettyPhoto[iframe]">
											<img src="/images/Pencil.png" style="width:20px ; height:20px;" />
										</a>
										</ul>
									</div>
								</div>
								<?php } ?>
							</li>
								<?php } ?>
							<?php } ?>
						</ul>
						<div style="clear: both;"></div>
					</li>
					
				<?php }?>
				</ul>
			</div>
		</div><!--end categories-->
		<div style="clear:both"></div>
	</div>
	<div class="bottom_box"><span></span></div>
</div>
	
<?php } else { ?>
			<link rel="stylesheet" type="text/css" href="/css/category.css" />
			<div id="categories">
					<div class="c_navigator">
						<p class="navi_content"><?php echo $title;?></p>
						<?php if(isset($login)&& $login =="1" && isset($permission) && $permission=="true")  {?>
						<!-- Tạo cây bút chì cho click and change -->
						<div style="float: right;margin-right:5px">
						<ul class="gallery clearfix">
							<a href="/category/clickchange?iframe=true&width=370&height=250" rel="prettyPhoto[iframe]">
								<img src="/images/Pencil.png" style="width:20px ; height:20px; margin-top:10px;"></img>
							</a>
						</ul>
						</div>
						<!-- End - Tạo cây bút chì cho click and change -->
						
						<!-- Tạo bút add cho click and change -->
						<div style="float: right;margin-right:15px" >
						<ul class="gallery clearfix">
							<a href="/category/addpcategory?catetype=<?php echo $type; ?>&iframe=true&width=370&height=150" rel="prettyPhoto[iframe]">
								<img src="/images/button_add.png" style="width:20px ; height:20px; margin-top:10px;"></img>
							</a>
						</ul>
						</div>
						<!-- End - Tạo nút add cho click and change -->
						<?php  }?>
					</div> <!--end c_navigator-->
					<div id="navigation">
		    			<ul>
		    			<?php foreach ($Pprocategory as $pcategory){
		    			?>
						<li class='category'>
							<div style="float:left;">
								<a href="/<?php echo $type;?>/category?category=<?php echo $pcategory['category_id']; ?>"><?php echo $pcategory['category_name'];?></a>						
							</div>
							<?php if(isset($login)&& $login =="1" && isset($permission) && $permission=="true")  {?>
							<div style="float:right;border-bottom:0px dotted #aaa;">
								<!--nút xóa-->
								<div style="float:right;">
									<input type="button" id="" onclick="delcate(<?php echo $pcategory['category_id']; ?>)"  value="" style="background-image: url('/images/button_del.png'); border: none; width:20px;height:20px;margin-top:11px;">												
								</div>
								<!--bút chì-->
								<div style="float:right; margin-top:-12px;">
									<ul class="gallery clearfix">
									<a style="border-bottom:0px dotted #aaa;" href="/category/editpcategory?cateid=<?php echo $pcategory['category_id']; ?>&iframe=true&width=370&height=320" rel="prettyPhoto[iframe]">
										<img src="/images/Pencil.png" style="width:20px ; height:20px;margin-top:10px;" />
									</a>
									</ul>
								</div>
								<!--nút add-->
								<div style="float:right; margin-top:-12px;">
									<ul class="gallery clearfix">
									<a style="border-bottom:0px dotted #aaa;" href="/category/addlcategory?catetype=<?php echo $type; ?>&parent=<?php echo $pcategory['category_id']; ?>&iframe=true&width=370&height=150" rel="prettyPhoto[iframe]">
										<img src="/images/button_add.png" style="width:20px ; height:20px; margin-top:10px;"></img>
									</a>
									</ul>
								</div>
							</div>
							<?php  }?>
							<ul>
				    			<?php foreach ($Lprocategory as $lcategory){
									if($lcategory['parent_id']==$pcategory[category_id]){?>
										<li>
										<div style="float:left;height: 0px;">
											<a href="/<?php echo $type;?>/category?category=<?php echo $lcategory['category_id']; ?>"><?php echo $lcategory['category_name'];?></a>
										</div>
										<?php if(isset($login)&& $login =="1" && isset($permission) && $permission=="true")  {?>
										<div style="float:right;height: 0px;">
											<!--nút del-->
											<div style="float:right;">
												<input type="button" id="" onclick="delcate(<?php echo $lcategory['category_id']; ?>)"  value="" style="background-image: url('/images/button_del.png'); border: none; width:20px;height:20px;">												
											</div>
											<!-- bút chì-->
											<div style="float:right; margin-top:-12px;">
												<ul class="gallery clearfix">
												<a style="border-bottom:0px dotted #aaa;" href="/category/editlcategory?cateid=<?php echo $lcategory['category_id']; ?>&iframe=true&width=370&height=320" rel="prettyPhoto[iframe]">
													<img src="/images/Pencil.png" style="width:20px ; height:20px;" />
												</a>
												</ul>
											</div>
										</div>
										<?php } ?>
										</li>
										
										<?php } ?>
								<?php } ?>
								
								
							</ul>
							<div style="clear: both;"></div>
						</li>
						
						<?php }?>
						</ul>
					
				  </div>

				</div><!--end categories-->
<?php } ?>

<script type="text/javascript">
<?php if(isset($login)&& $login =="1" && isset($permission) && $permission=="true")  {?>
function delcate(id)
{ 
	var confirmed=confirm(<?php echo "'".$textWarning1."'";?>);
	if(confirmed==true)
	{
		var _id=id;
	
		if (window.XMLHttpRequest)
		{// code for IE7+, Firefox, Chrome, Opera, Safari
			xmlhttp=new XMLHttpRequest();
		
		}
		else
		{// code for IE6, IE5
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		xmlhttp.onreadystatechange = function()
		{	if (xmlhttp.readyState==4 && xmlhttp.status==200)
			{
				if(xmlhttp.responseText == -2)
				{
					alert(<?php echo "'".$textError2."'";?>);
				}
				else if(xmlhttp.responseText == -3 )
				{
					alert(<?php echo "'".$textError3."'";?>);
				}
				else if(xmlhttp.responseText == -12)
				{
					alert(<?php echo "'".$textError12."'";?>);
				}
				else if(xmlhttp.responseText == -13 )
				{
					alert(<?php echo "'".$textError13."'";?>);
				}
				else
				{
					alert(<?php echo "'".$textDelsuccess."'";?>);
					window.top.location.reload();
				}
			}
		};
	
		var url = "/category/clickchange/delete?id="+_id;
		xmlhttp.open("GET",url,true);	
		xmlhttp.send();
		return false;
	}
}
<?php } ?>
</script>